/**
 * @Title: DemoRabbitMqReceiver.java
 * @Description:
 * @author zsw
 * <p>
 * Copyright(C) 2018-2019    NPlus
 * Company:   无锡核心信息科技有限公司
 * @version V2.0.0
 * @Date: 10:54 2019/10/18
 * <p>
 * 修改历史:
 * Date                 Author        Version        Description
 * -----------------------------------------------------------------------------------
 * 10:54 2019/10/18       zsw        2.0.0           初始化版本
 */
package com.example.springjpa.receiver;


import com.example.springjpa.model.Student;
import net.sf.json.JSONObject;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
//@RabbitListener(queues = "hello")
public class DemoRabbitMqReceiver {

    @RabbitHandler
    public void process(String content) {
        JSONObject jsonObject2=JSONObject.fromObject(content);
        Student stu2=(Student)JSONObject.toBean(jsonObject2, Student.class);
        System.out.println("Receiver : " + stu2.toString());
    }

}